package com.starmark.gateway.auth.security.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.ArrayList;
import java.util.List;

/**
 * @author starmark
 * @since 2020/8/13 001320:48
 **/
@Data
@Configuration

@ConfigurationProperties(prefix = "starmark")
public class IgnoreUrlConfig {

    private List<String> ignoreUrls=new ArrayList<>();


    /**
     * 判断URL 是否自动跳过
     * @param url url
     * @return 自动跳过
     */
    public boolean isIgnoreUrl(String url){
        return  ignoreUrls.stream().anyMatch(url::contains);

    }
}
